package com.jic.member.controller.rest;

import com.jic.member.api.rest.MessageApi;
import com.jic.member.request.TestSendMessageRequest;
import com.jic.member.response.MessageResponse;
import com.jic.member.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author MJ
 */
@RestController
@RequestMapping("/rest/messageApi")
@Slf4j
public class MessageApiRestController implements MessageApi {

    @Autowired
    MessageService messageService;

    @Override
    public Boolean branchNodeBySendMessage(Long tripId, Long branchNodeId, List<String> userIds) {
        return messageService.branchNodeBySendMessage(tripId, branchNodeId, userIds);
    }

    @Override
    public MessageResponse sendTestMessage(TestSendMessageRequest testSendMessageRequest) {
        MessageResponse messageResponse = messageService.sendTestMessage(testSendMessageRequest);
        return messageResponse;
    }
}
